# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String, Text
from sqlalchemy.schema import FetchedValue
from flask_sqlalchemy import SQLAlchemy
from fullstack import db


class AppErrorLog(db.Model):
    __tablename__ = 'app_error_log'

    id = db.Column(db.Integer, primary_key=True)
    referer_url = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'), nullable=False, server_default=db.FetchedValue())
    target_url = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'), nullable=False, server_default=db.FetchedValue())
    query_params = db.Column(db.Text(collation='utf8mb4_0900_ai_ci'), nullable=False)
    content = db.Column(db.String(collation='utf8mb4_0900_ai_ci'), nullable=False)
    created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
